package com.ccrfid.rmc6.service.sys;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.sys.OrgEntity;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface OrgService {
    //
    List<OrgEntity> getOrgListByType(Integer typeId);
    //
    List<OrgEntity> getOrgList();
    //
    @Cacheable(value = "org", key = "'getSubOrgList' + #orgId")
    List<OrgEntity> getSubOrgList(Long orgId);
    //
    @Cacheable(value = "org", key = "'getSubOrgIdList' + #orgId")
    List<Long> getSubOrgIdList(Long orgId);
    //
    @Cacheable(value = "org", key = "'getOrgInfoById' + #orgId")
    OrgEntity getOrgInfoById(Long orgId);
    //
    @Cacheable(value = "org", key = "'getOrgInfoBySn' + #orgSn")
    OrgEntity getOrgInfoBySn(String orgSn);
    //
    @CacheEvict(value = "org", allEntries = true)
    OrgEntity createOrg(OrgEntity entity) throws AppException;
    //
    @CacheEvict(value = "org", allEntries = true)
    OrgEntity updateOrg(Long orgId, OrgEntity entity) throws AppException;
    //
    @CacheEvict(value = "org", allEntries = true)
    int deleteOrgs(List<Long> idList);
    //
    List<OrgEntity> getAllPrisonAreas();
    //获取某个机构下的所有监区
    List<OrgEntity> getAllPrisonAreasByOrgId(Long orgId);
    //
    List<OrgEntity> getAllPrisonRooms();

    List<OrgEntity> getAllPrisonRoomsByPid(Long orgId);

    List<OrgEntity> getAllPrisonRoomsByOrgName(List<Long> orgIdList, String orgName);
}
